package com.gnerv.rabbitmq.agent.handler;

import com.gnerv.rabbitmq.agent.model.entity.NodeStatus;

/**
 * @author Gnerv LiGen
 */
public abstract class AbstractStatusExecResultHandler extends ExecResultHandler<NodeStatus> {

    protected NodeStatus nodeStatus = new NodeStatus();

    protected abstract void nodeName();

    protected abstract void version();

    protected abstract void type();

    protected abstract void status();

    protected abstract void fileDescriptors();

    protected abstract void sockets();

    protected abstract void processes();

    protected abstract void diskFree();

    protected abstract void diskFreeLimit();

    protected abstract void memoryUsed();

    protected abstract void memoryLimit();

    protected abstract void memoryHighWatermark();

    protected abstract void memoryCalculationStrategy();

    protected abstract void os();

    protected abstract void erlangVersion();

    protected abstract void listeners();

    protected abstract void uptime();

    @Override
    public final NodeStatus handle() {
        nodeName();
        version();
        type();
        status();
        fileDescriptors();
        sockets();
        processes();
        diskFree();
        diskFreeLimit();
        memoryUsed();
        memoryLimit();
        memoryHighWatermark();
        memoryCalculationStrategy();
        os();
        erlangVersion();
        listeners();
        uptime();
        return this.nodeStatus;
    }

}
